<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="cn.firstsoft.firstframe.admin.PropertyFile"%>
<%@ page import="org.springside.core.Constants" %>
<%@ page import="java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>管理控制台 - 系统工具 - 控制台用户密码</title>
<%@ include file="/common/meta2.jsp"%>
<link href="../style.css" type="text/css" rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
	<table width="100%" align="center" >
		<TR>
			<TH class=listViewPaginationTdS1  align=left colSpan=4>
			控制台用户密码设置结果

			</TH>
		</TR>	
		<tr>
			<td widht="100%">
<%

	String username = request.getParameter("username");
	if (username == null ) username = "";
	String password = request.getParameter("password");
	if (password == null ) password = "";
	String oldpassword = request.getParameter("oldpassword");
	if (oldpassword == null ) oldpassword = "";
	
	String verpassword = PropertyFile.readValue("user.properties","password");
	if (verpassword == null) verpassword = "ZXCVB";	
	
	if (!verpassword.equals(oldpassword)) {
		out.println("请输入的原密码不正确，不能进行密码和用户的修改！");
	} else {
		PropertyFile.writeProperties("user.properties", "username", username);
		PropertyFile.writeProperties("user.properties", "password", password);
		out.println("<br>用户、密码修改完成，修改文件：user.properties");
	}
%>
<BR>
设置成功后，退出，使用新的用户名和密码登录！<a href="user.jsp">返回设置页面</a>
			</td>
		</tr>
	</table>
</body>
</html>
